package com.xiaobai.netease_news.model;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2015/6/24 0024.
 */
public class Clist {

    private List<Tlist> tlistList;
    private String cid;
    private String cname;

    public void parseJSON(JSONObject json) {
        cid = json.optString("cid");
        cname = json.optString("cname");
        tlistList = new ArrayList<Tlist>();
        JSONArray tLists = json.optJSONArray("tList");
        for (int i=0;i<tLists.length();i++){
            JSONObject jsonObject = tLists.optJSONObject(i);
            Tlist tlist = new Tlist();
            tlist.parseJSON(jsonObject);
            tlistList.add(tlist);
        }
    }

    public List<Tlist> getTlistList() {
        return tlistList;
    }

    public String getCid() {
        return cid;
    }

    public String getCname() {
        return cname;
    }
}
